@extends('default.layouts.simple_vice_head_foot')
@section('title'){{$find_job.'_'.Site::get('webname')}} @endsection
@section('insert_css')
    {{--添加样式表--}}
    <link rel="stylesheet" href="{{asset('/default/css/index/vice_public.css')}}">
    <link rel="stylesheet" href="{{asset('/default/css/index/previewresume.css')}}">
    <link rel="stylesheet" href="{{asset('/vendor/jedate/skin/jedate.css')}}">
    <link rel="stylesheet" href="{{asset('/default/css/index/station.css')}}">
@endsection
@section('content')

    {{--副页菜单模版--}}
    @include('default.layouts.index_vice_mune')
    {{--分站列表--}}
    @include('default.layouts.station')
    {{--内容区显示区--}}
    <div class="vicecontent">
        {{--阴影线--}}
        <div class="shadow_line"></div>
        <div class="line20">&nbsp;</div>
        <div class="content border border_buttom_none">
            <div class="presumehead">
                <ul>
                    <li class="left">简历编号：{{ $reArr['id'] }}</li>
                    <li class="right">最近登录：{{ $reArr['lastlogintime'] }}</li>
                </ul>
            </div>
            {{--简历信息--}}
            <div class="resume">
                {{--头像与信息--}}
                <div class="frist">
                    <ul>
                        <li class="left">
                            <img src="{{asset($reArr['avatar'])}}">
                        </li>
                        <li class="right">
                            <ul class="son_ul">
                                <li class="list1 name">
                                    @if(!auth()->guard('company')->check())
                                        @if($reArr['sex'] == '男')
                                            {{ mb_substr($reArr['name'],0,1)}}先生
                                        @else
                                            {{ mb_substr($reArr['name'],0,1)}}女士
                                        @endif
                                    @else
                                        {{ $reArr['name']}}
                                    @endif
                                </li>
                                <li class="list2 list">
                                    <i>{{ $reArr['sex']}}</i>|<i>{{ $reArr['birthday']}}</i>|<i>{{ $reArr['education']}}</i>|<i>{{ $reArr['work_year']}}</i>|<i>{{ $reArr['height'] }}</i>|<i>{{ $reArr['marital'] }}</i>
                                </li>
                                <li class="list3">
                                    <i>户籍：<em>{{ $reArr['census'] }}</em></i>
                                    <i>现居：<em>{{ $reArr['homeaddress'] }}</em></i>
                                </li>
                                <li class="list3">
                                   <i>地址：<em> @if(!empty($reArr['address'])){{ str_limit($reArr['address'],72 )}}@else{{ $reArr['homeaddress'] }}@endif</em></i>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
                {{--如果已查看过，显示联系方式--}}
                <div class="contactinfo">
                    @if($lookStatus == 3 )
                        <ul>
                            <li><span>联系电话：<i>{{ $reArr['mobile']}}</i></span></li>
                            <li><span>邮箱地址：<i>{{ $reArr['email']}}</i></span></li>
                            <li><span>QQ号码 ：<i>{{ $reArr['qq']}}</i></span></li>
                        </ul>
                    @elseif(($lookStatus == 1 || $lookStatus == 2) && Auth::guard('company')->check() )
                        <ul>
                            <li><span>联系电话：<i>{{ $reArr['mobile']}}</i></span></li>
                            <li><span>邮箱地址：<i>{{ $reArr['email']}}</i></span></li>
                            <li><span>QQ号码 ：<i>{{ $reArr['qq']}}</i></span></li>
                        </ul>
                    @elseif(Auth::guard('company')->check() && $user->resumeNumber() )
                        <ul>
                            <li><span>温馨提示：</span><span class="resumeNumber">您的可下载简历数还剩<b>{{$user->resumeNumber()}}</b>份。</span></li>
                        </ul>
                    @elseif(Auth::guard('company')->check())
                        <ul>
                            <li><span>温馨提示：</span><span class="resumeNumber">您的可下载简历数还剩<b>0</b>份。<a href="{{url("/company/my_order")}}">马上充值>></a></span></li>
                        </ul>
                    @endif
                </div>
                {{--按钮--}}
                @if($lookStatus != 3 )
                    <div class="second">
                        @if($lookStatus == 0)
                            <input type="button" value="查看联系方式" class="{{ $look_button }}">
                        @endif
                        <input type="button" value="面试邀请" class="{{ $interview_button }}">
                        <input type="button" value="{{ $insertPersonnelLibrary_text }}"
                               class="{{ $insertPersonnelLibrary_button }}">
                        @if(Auth::guard('company')->check())
                            @if(Auth::guard('company')->user()->resumeNumber() > 1)
                                <input type="button" value="简历下载" class="resumeDown">
                            @else
                                <input type="button" value="简历下载" class="resumeBuy">
                            @endif
                        @endif

                        @if(Auth::guard('company')->check())
                               <input class="resume_complain_button" type="button" value="简历投诉">
                        @endif
                    </div>
                @endif
                {{--求职意向--}}
                <div class="third">
                    <div class="title"><em></em><span>求职意向</span></div>
                    <dl>
                        <dt>希望从事：</dt>
                        <dd>{{ str_limit($reArr['intentionjobs'],80) }} | @if($reArr['isexpectedsalary'])
                                面议@else{{ $reArr['expectedsalary'] }}@endif</dd>
                        <dt>工作地点：</dt>
                        <dd>{{ $reArr['jobarea'] }}</dd>
                        <dt>期望岗位：</dt>
                        <dd>{{ $reArr['jobsort'] }}</dd>
                        <dt>求职状态：</dt>
                        <dd>{{ $reArr['job_status'] }}</dd>
                    </dl>
                </div>

                {{--简历备注开始--}}
                @if(Auth::guard('company')->check())
                    @if(empty($resumeRemark)) 
                        <div id="remark">
                            <dl>
                                <dd class="remark_head_a1"></dd>
                                <dd class="remark_head_a2">简历备注</dd>
                                <dd class="remark_head_a3"><a class="remark_edit" href="javascript:void(0)">编辑</a></dd>
                            </dl>
                            <p>您还没对该简历进行信息备注，马上编辑!</p>
                        </div> 
                    @else  
                        <div id="remark_a">
                            <dl>
                                <dd class="remark_head_a1"></dd>
                                <dd class="remark_head_a2">简历备注</dd>
                                <dd class="remark_head_a3"><a class="remark_edit" href="javascript:void(0)">编辑</a></dd>
                            </dl>
                            <dl class="remark_a_content">
                                <dd>
                                    <span class="a" style="position:relative;left:14px;">应聘岗位：</span>
                                    <span style="position:relative;left:12px;">{{$resumeRemark->job_name or ''}}</span>
                                </dd>
                                <dd><span class="a">录用情况统计：</span>
                                    <span>
                                        @if($resumeRemark->record == 1)
                                            未通知面试
                                        @elseif($resumeRemark->record == 2)
                                            已通知面试
                                        @elseif($resumeRemark->record == 3)
                                            已参加面试
                                        @elseif($resumeRemark->record == 4)
                                            不录用
                                        @elseif($resumeRemark->record == 5)
                                            决定录用
                                        @elseif($resumeRemark->record == 6)
                                            已上班
                                        @else
                                            离职
                                        @endif
                                    </span>
                                </dd>
                                <dd><span class="a">人才合适度：</span>
                                    <span>
                                        @if($resumeRemark->suitable == 1)
                                            不合适
                                        @elseif($resumeRemark->suitable == 2)
                                            合适
                                        @elseif($resumeRemark->suitable == 3)
                                            比较合适
                                        @elseif($resumeRemark->suitable == 4)
                                            非常合适
                                        @else
                                            非常好但不合适
                                        @endif
                                    </span>
                                </dd>
                            </dl>
                            <p style="clear:both;padding:15px 0 0 47px;"><span style="color:#999999;">备注：</span>{{$resumeRemark->content or ''}}</p>
                        </div>
                    @endif 

                    <div id="remark_b" style="display:none;">
                        <dl>
                            <dd class="remark_head_a1"></dd>
                            <dd class="remark_head_a2">简历备注</dd>
                            <dd class="remark_head_a3"><a class="remark_save" href="javascript:void(0)">保存</a></dd>
                        </dl>

                        <div id="remark_b_content">
                            {{--应聘岗位开始--}}
                            <div id="job_id">
                                <dl>
                                    <dt class="b">应聘岗位：</dt>
                                    <dd style="position:relative;left:14px;">
                                        <input id="job_id_s" name="job_id" type="hidden" value="">
                                        <div id="job_id_s_select" class="select" style="float:left;width:160px;">
                                            <span><a>请选择</a></span><i></i></div>
                                    </dd>
                                </dl>
                            </div>
                            
                            {{--应聘岗位结束--}}

                            {{--录用情况统计开始--}}
                            <div id="record">
                                <dl>
                                    <dt class="b">录用情况统计：</dt>
                                    <dd>
                                        <input id="record_s" name="record" type="hidden" value="">
                                        <div id="record_s_select" class="select" style="float:left;width:160px;">
                                            <span><a>请选择</a></span><i></i></div>
                                    </dd>
                                </dl>
                            </div>
                           
                            {{--录用情况统计结束--}}

                            {{--人才合适度开始--}}
                            <div id="suitable">
                                <dl>
                                    <dt class="b">人才合适度：</dt>
                                    <dd>
                                        <input id="suitable_s" name="suitable" type="hidden" value="">
                                        <div id="suitable_s_select" class="select" style="float:left;width:160px;">
                                            <span><a>请选择</a></span><i></i></div>
                                    </dd>
                                </dl>
                            </div>
                            {{--人才合适度结束--}}
                        </div>

                        <div class="text">
                            <span class="text1">备注</span>
                            <span class="text2">
                                <textarea id="remark_content" name="content">{{$resumeRemark->content or ''}}</textarea>
                            </span>
                        </div>
                    </div> 
                    {{--保存提交后的事件--}}
                    <div id="remark_save_edit" style="display:none;">
                        <dl>
                            <dd class="remark_head_a1"></dd>
                            <dd class="remark_head_a2">简历备注</dd>
                            <dd class="remark_head_a3"><a class="remark_edit" href="javascript:void(0)">编辑</a></dd>
                        </dl>
                        <dl class="remark_a_content">
                            <dd>
                                <span class="a" style="position:relative;left:14px;">应聘岗位：</span>
                                <span id="ypgw" style="position:relative;left:12px;"></span>
                            </dd>
                            <dd><span class="a">录用情况统计：</span>
                                <span id="lyqk"></span>
                            </dd>
                            <dd><span class="a">人才合适度：</span>
                                <span id="rchs"></span>
                            </dd>
                        </dl>
                        <p style="clear:both;padding:15px 0 0 47px;"><span style="color:#999999;">备注：</span><span id="bzz"></span></p>
                    </div>
                @endif
                {{--简历备注结束--}}

                {{--自我评价--}}
                @if(!empty($reArr['introduction']))
                    <div class="third">
                        <div class="title ico"><em></em><span>自我评价</span></div>
                        <div class="info evaluation"><p>{!! nl2br(e($reArr['introduction'])) !!}</p></div>
                    </div>
                @endif
                {{--工作经历--}}
                @if(count($workExpArr) > 0)
                    <div class="third">
                        <div class="title ico2"><em></em><span>工作经历</span></div>
                        @foreach($workExpArr as  $k=> $v)
                            <div class="info line @if($k==0) infoOne @elseif($k==count($workExpArr)-1) infoLast @endif">
                                <div class="time">{{$v['starttime']}}~{{$v['endtime']}}</div>
                                <div class="duties">
                                    <strong>{{$v['post']}}</strong><i>|</i><span>{{$v['company']}}</span>
                                </div>
                                <div class="duties">
                                    <span>{{$v['comkind']}}</span><i>-</i><span>{{$v['scale']}}</span><i>-</i><span>{{$v['industry']}}</span>
                                </div>
                                @if(!empty($v['content']))
                                    <div class="con"><p>{!! nl2br(e($v['content'])) !!}</p></div>  @endif
                            </div>
                        @endforeach
                    </div>
                @endif
                {{--教育经历--}}
                @if(count($eduExpArr) > 0)
                    <div class="third">
                        <div class="title ico3"><em></em><span>教育培训经历</span></div>

                        @foreach($eduExpArr as  $k=> $v)
                            <div class="info line @if($k==0) infoOne @elseif($k==count($eduExpArr)-1) infoLast @endif">
                                <div class="time">{{$v['starttime']}}~{{$v['endtime']}}</div>
                                <div class="duties">
                                    @if($v['edu_type']=='1')
                                        <strong>{{$v['education']}}</strong>
                                    @elseif($v['edu_type']=='2')
                                        <strong>{{$v['speciality']}}</strong>
                                    @endif
                                    <i>|</i><span>{{$v['school']}}</span>
                                </div>
                                <div class="duties">
                                    @if($v['edu_type']=='1')
                                        <span>专业名称：</span><span class="served">{{$v['speciality']}}</span>
                                    @endif
                                </div>
                                @if(!empty($v['description']))
                                    <div class="con"><p>{!! nl2br(e($v['description'])) !!}</p></div>  @endif
                            </div>
                        @endforeach
                    </div>
                @endif
                {{--项目经验--}}
                @if(count($projectExpArr) > 0)
                    <div class="third">
                        <div class="title ico4"><em></em><span>项目经验</span></div>
                        @foreach($projectExpArr as  $k=> $v)
                            <div class="info line  @if($k==0) infoOne @elseif($k==count($projectExpArr)-1) infoLast @endif">
                                <div class="time">{{$v['starttime']}}~{{$v['endtime']}}</div>
                                <div class="duties">
                                    <strong>{{$v['project_name']}}</strong><i>|</i><span
                                            class="orange">担任职务：{{$v['post']}}</span>
                                </div>
                                @if(!empty($v['content']))
                                    <div class="con"><p>{!! nl2br(e($v['content'])) !!}</p></div>  @endif
                            </div>
                        @endforeach
                    </div>
                @endif
                {{--语言能力--}}
                @if(count($languageArr) > 0)
                    <div class="third">
                        <div class="title ico5"><em></em><span>语言能力</span></div>
                        <div class="info">
                            @foreach($languageArr as $v)
                                <div class="duties listItem">
                                    <strong>{{$v['language']}}</strong>
                                    <span class="degree">{{$v['degree']}}</span>
                                    @if(!empty($v['level']))<i>|</i><span>{{$v['level']}}</span>@endif
                                </div>
                            @endforeach
                        </div>
                    </div>
                @endif
                {{--技能专长--}}
                @if(count($skillArr) > 0)
                    <div class="third">
                        <div class="title ico6"><em></em><span>技能专长</span></div>
                        <div class="info">
                            @foreach($skillArr as $v)
                                <div class="duties listItem">
                                    <strong>{{$v['skillname']}}</strong>
                                    <span class="degree">{{$v['degree']}}</span>
                                </div>
                            @endforeach
                        </div>
                    </div>
                @endif
                {{--证书--}}
                @if(count($certificateArr) > 0)
                    <div class="third">
                        <div class="title ico7"><em></em><span>证书</span></div>
                        <div class="info">
                            @foreach($certificateArr as $v)
                                <div class="duties listItem">
                                    <strong>{{$v['certificate_name']}}</strong>
                                    <span class="degree">{{$v['gettime']}}年获得</span>
                                </div>
                            @endforeach
                        </div>
                    </div>
                @endif
                {{--其它信息--}}
                @if(count($otherArr) > 0)
                    <div class="third">
                        <div class="title ico8"><em></em><span>其它信息</span></div>
                        @foreach($otherArr as  $k=> $v)
                            <div class="info">
                                <div class="other">
                                    <span>{{str_limit($v['title'],8)}}：</span>
                                    <p class="other">{!! nl2br(e($v['content'])) !!}</p>
                                </div>
                            </div>
                        @endforeach
                    </div>
                @endif
                {{--工作作品--}}
                @if(count($worksArr) > 0)
                    <div class="third ">
                        <div class="title ico9"><em></em><span>工作作品</span></div>
                        <div class="listCon">
                            <ul>
                                @foreach($worksArr as $v)
                                    <li id="liCon{{$v['id']}}">
                                        <div class="workImg" id="workImg{{$v['id']}}">
                                            <input type="hidden" value="{{$v['id']}}">
                                            <input type="hidden" value="{{$v['works_name']}}">
                                            <input type="hidden" value="{{$v['description']}}">
                                            <span class="img"><a><img src="{{$v['imgurl']}}"></a></span>
                                            <span class="imgTit"><a>{{$v['works_name']}}</a> </span>
                                        </div>
                                    </li>
                                @endforeach
                            </ul>
                        </div>
                    </div>
                @endif
                <div class="line20"></div>
            </div>{{--end content--}}
        </div>
    </div>

    {{--按钮弹出对话框--}}
    <div class="eject">
        <div class="hide_box"></div>
        <div class="shang_box">
            <a class="shang_close" href="javascript:void(0)" title="关闭"><img
                        src="{{asset('/default/images/index/close.jpg')}}" alt="取消"/></a>
            <div id="eject_content">
            </div>
        </div>
    </div>

    {{--浮动层--}}
    {{--右边浮动--}}
    @if(!empty($resumelist) && count($resumelist)>0)
        <div id="browse_resume" class="browse_resume">
            <ul>
                <li class="topTitle">简历库</li>
                @foreach($resumelist as $k => $v)
                    @if($k<=10)
                        <li id="list{{ $k }}" class="resume_name @if($v->id == $id) resumecheck @endif"><a
                                    href="{{ $v->url }}"><span>{{ $v->name }}</span></a></li>
                    @endif
                @endforeach
                <li class="buttom">关闭</li>
            </ul>
        </div>
    @endif
    {{--@include('default.layouts.floating')--}}
@endsection
@section('insert_js')
    <script type="text/javascript" src="{{ asset("/vendor/org/layer/layer.js") }}"></script>
    <script type="text/javascript" src="{{ asset("/default/js/index/ejectlogin.js") }}"></script>
    <script type="text/javascript" src="{{ asset("/default/js/jquery/jquery.validate.min.js") }}"></script>
    <script type="text/javascript" src="{{ asset("/default/js/jquery/jquery.form.js") }}"></script>
    <script type="text/javascript" src="{{ asset("/default/js/jquery/jquery.validate.extend.js") }}"></script>
    <script type="text/javascript" src="{{ asset("/default/js/jquery/jquery.jedate.js") }}"></script>
    <script type="text/javascript" src="{{ asset("/default/js/index/interview.js") }}"></script>
    <script type="text/javascript" src="{{ asset("/default/js/index/insertPersonnelLibrary.js") }}"></script>
    <script type="text/javascript">
        $(function(){
            //查看联系方式登录按钮
            $(".companylogin").click(function(){
                $.companyEject({
                    className: "companylogin",
                    csrf: "{{ csrf_token() }}",
                    QQLogin: "{{ Site::get('CompanyAppid') }}",
                    weiXin: "{{ Site::get('mpCompanyOpenAppID') }}",
                    weiXinUrl: "{{ weiXinlogin('company') }}",
                    phone: "{{ Site::get('tel') }}",
                    callBack: function(status){
                        //alert(status);//422 密码错误，0成功，但目前做了 reload
                    }
                });
            });
            //面试邀请登录按钮
            $(".companylogin2").click(function(){
                $.companyEject({
                    className: "companylogin2",
                    csrf: "{{ csrf_token() }}",
                    QQLogin: "{{ Site::get('CompanyAppid') }}",
                    weiXin: "{{ Site::get('mpCompanyOpenAppID') }}",
                    weiXinUrl: "{{ weiXinlogin('company') }}",
                    phone: "{{ Site::get('tel') }}",
                    callBack: function(status){
                    }
                });
            });
            //纳入人才库登录按钮
            $(".companylogin3").click(function(){
                $.companyEject({
                    className: "companylogin3",
                    csrf: "{{ csrf_token() }}",
                    QQLogin: "{{ Site::get('CompanyAppid') }}",
                    weiXin: "{{ Site::get('mpCompanyOpenAppID') }}",
                    weiXinUrl: "{{ weiXinlogin('company') }}",
                    phone: "{{ Site::get('tel') }}",
                    callBack: function(status){
                    }
                });
            });
            //绑定查看联系方式
            $(".button1").click(function(){
                $.getContact({
                    userName: "{{ $reArr['name']}}",
                    url: "{{url('company/personcontact')}}",
                    crsf: "{{csrf_token()}}",
                    resumeId: "{{ $reArr['id'] }}",
                    callBack: function(status){
                        //alert(status);//0您的简历数已用尽，1显示联系方式成功2您的会员时间已过期
                    }
                });
            });
            //绑定面试邀请框
            $(".button2").click(function(){
                $.interview({
                    userName: "{{ $reArr['name']}}",
                    url: "{{url('company/inviteinterview')}}",
                    interviewUrl: "{{url('company/interviewnote')}}",
                    postJobUrl: "{{ url("company/jobpublish") }}",
                    crsf: "{{csrf_token()}}",
                    resumeId: "{{ $reArr['id'] }}",
                    callBack: function(status){
                        //alert(status);//0发布成功，1您今天已邀请过了，或未选择面试工作2企业未发布工作岗位
                    }
                });
            });
            //绑定纳入人才库
            $(".button3").click(function(){
                $.insertPersonnelLibrary({
                    userName: "{{ $reArr['name']}}",
                    url: "{{ route('toShowCompanyJobList') }}",
                    personnelLibraryUrl: "{{ route('insertPersonnelLibrary')}}",
                    postJobUrl: "{{ url("company/jobpublish") }}",
                    delPersonnelLibrary: "{{ route("delPersonnelLibrary") }}",
                    distributionJob: "{{ route("distributionJob") }}",
                    crsf: "{{csrf_token()}}",
                    resumeId: "{{ $reArr['id'] }}",
                    sign: true,
                    callBack: function(status){
                        //alert(status);//0发布成功，1您今天已邀请过了，或未选择面试工作2企业未发布工作岗位
                    }
                });
            });
            //简历下载
            $(".resumeDown").click(function(){
                window.location.href = "{{ route("resume.down",[$reArr['id']]) }}";
            });   

            //企业会员简历投诉(开始)-------------------------------------------
            function complain_send(){
                var ids = '';
                $('.blue').each(function(i,rows){
                    ids += $(this).attr('data_opt_id')+',';
                });
                if(ids == ''){
                    layer.msg('投诉类型不能为空!');
                    return false;
                }

                $.ajax({
                    type:'post',
                    url:"{{url('company/resume_complain_send')}}",
                    data:{
                        _token: "{{ csrf_token() }}",
                        ids:ids,
                        resume_id:"{{$reArr['id']}}"
                    },
                    success:function(data){
                        if(data == 1){
                            layer.msg('您还没登录企业会员!');
                            return false;
                        }
                        layer.msg('投诉成功!');
                        $('.complain_qx').trigger('click');
                    }
                });
            }

            $('.resume_complain_button').on('click',function(){ //投诉按钮事件
                $.ajax({
                    type:'post',
                    async:false,
                    url:"{{url('company/resume_complain')}}",
                    data:{
                        _token: "{{ csrf_token() }}",
                        resume_id:"{{$reArr['id']}}"
                    },
                    success:function(data){ 
                        if(data == 1){
                            layer.msg('您还没登录企业会员!');
                            return false;
                        }

                        var str = '';
                        $.each(data.collOption,function(i,rows){
                            var statuss = 0;
                            $.each(data.ids,function(j,rowss){
                                if(rows.value == rowss){
                                    statuss = 1;
                                }
                            });
                            if(statuss == 0){
                               str +='<dd><a class="complain_type" data_opt_id='+rows.value+'>'+rows.text+'</a></dd>'; 
                            }else{
                               str +='<dd><a class="complain_type blue" data_opt_id='+rows.value+'>'+rows.text+'</a></dd>'; 
                            }
                        });

                    html = '<div id="complain"><dl>'+str+'</dl><p class="qxx" style="padding:25px 0 0 120px;"><input type="button" value="投诉" class="complain_tj" style="margin-right:30px;"/> <a class="layui-layer-ico layui-layer-close layui-layer-close1 complain_qx" href="javascript:;">取消</a></div>';

                        layer.open({
                            type: 1,
                            title: "投诉",
                            skin: 'layui-layer-rim', 
                            area: ['450px', '350px'], 
                            content: html
                        });
                        
                        //投诉类型点击事件
                        $('.complain_type').on('click',function(){
                            if($(this).hasClass('blue')){
                                $(this).removeClass('blue');
                            }else{
                                $(this).addClass('blue');
                            }
                        });
                       
                        //投诉按钮
                        $('.complain_tj').on('click',function(){
                            complain_send();
                        });
                    }
                });
            });
            //企业会员简历投诉(结束)-------------------------------------------

            //简历备注(开始)---------------------------------------------------
            //编辑事件
            $('.remark_edit').on('click',function(){
                $(this).parent().parent().parent().hide();
                $('#remark_b').show();
            });

            //应聘岗位
            var option_job_id_s = [
                {"value": 0, "text": "---请选择---"},
                @if(!empty($companyJob))
                    @foreach($companyJob as $v)
                    {
                        "value": "{{$v->id}}", "text": "{{$v->job_title}}"
                    },
                    @endforeach
                @endif
                ];

            var job_id_s_select = $("#job_id_s").select({
                optionData: option_job_id_s
            });
            @if(!empty($resumeRemark))
                job_id_s_select.resetSelected({{$resumeRemark->job_id}});
            @endif

            //录用情况统计
            var option_record_s = [
                {"value": 0, "text": "---请选择---"},
                {"value":1,"text":"未通知面试"},
                {"value":2,"text":"已通知面试"},
                {"value":3,"text":"已参加面试"},
                {"value":4,"text":"不录用"},
                {"value":5,"text":"决定录用"},
                {"value":6,"text":"已上班"},
                {"value":7,"text":"离职"},
            ];
            var record_s_select = $("#record_s").select({
                optionData: option_record_s
            });
            @if(!empty($resumeRemark))
                record_s_select.resetSelected({{$resumeRemark->record}});
            @endif

            //人才合适度
            var option_suitable_s = [
                {"value": 0, "text": "---请选择---"},
                {"value":1,"text":"不合适"},
                {"value":2,"text":"合适"},
                {"value":3,"text":"比较合适"},
                {"value":4,"text":"非常合适"},
                {"value":5,"text":"非常好但不合适"},
                
            ];
            var suitable_s_select = $("#suitable_s").select({
                optionData: option_suitable_s
            });
            @if(!empty($resumeRemark))
                suitable_s_select.resetSelected({{$resumeRemark->suitable}});
            @endif

            //保存事件
            $('.remark_save').on('click',function(){
                var job_id   = $('input[name="job_id"]').val();
                var record   = $('input[name="record"]').val();
                var suitable = $('input[name="suitable"]').val();
                if(job_id == 0){
                    layer.msg('请选择应聘岗位!');
                    return false;
                }
                if(record == 0){
                    layer.msg('请选择录用情况统计!');
                    return false;
                }
                if(suitable == 0){
                    layer.msg('请选择人才合适度!');
                    return false;
                }
                 $.ajax({
                    type:'post',
                    url:"{{url('company/resume_remark_save')}}",
                    data:{
                        _token: "{{ csrf_token() }}",
                        resume_id:"{{$reArr['id']}}",
                        job_id:job_id,
                        record:record,
                        suitable:suitable,
                        content:$('#remark_content').val()
                    },
                    success:function(data){ 
                        if(data == 1){
                            layer.msg('您还没登录企业会员!');
                            return false;
                        }
                        layer.msg('保存成功!');
                        $('#ypgw').text(data.resumeRemark.job_title);
                        $('#bzz').text(data.resumeRemark.content);
                        $('#lyqk').text(data.resumeRemark.record);
                        $('#rchs').text(data.resumeRemark.suitable);
                        $('#remark_b').hide();
                        $('#remark_save_edit').show();
                    }
                });
            });
            //简历备注(结束)-------------------------------------------------

            //询问是否购买简历数
            $(".resumeBuy").click(function(){
                resumeBuy = layer.confirm('亲，您的会员已到期或简历数已用尽。', {
                            btn: ['重新购买套餐', '稍候再买'] //按钮
                        },
                        function(){//success
                            //跳转到vip套餐页面
                            window.open("/company/my_order", "_blank");
                            layer.close(resumeBuy);
                        },
                        function(){//false
                            layer.close(resumeBuy);
                        }
                );
            });
        });
        //设置更多值，重哪一个下标开始
        var moreIndex = 10;
        //右边浮动框
        var moreX = define_browse_resume()['x'];
        var fix_h = define_browse_resume()['y'];
        //多出的简历显示
        $(function(){
            userResumeNum = $("#browse_resume").find('li').length - 2;
            if(userResumeNum >= moreIndex){
                //取得更多的x,y位置
                var moreY = (fix_h + $("#browse_resume").height() - $(".buttom").height());
                $("#browse_resume").find('li').eq(userResumeNum).after("<li id='moreResume' class='resume_name' ><< 更多 </li>");
                jsName = "{{ $jsName }}";
                jsUrl = "{{ $jsUrl }}";
                jsId = "{{ $jsId }}";
                jsName = jsName.split('|');
                jsUrl = jsUrl.split('|');
                jsId = jsId.split('|');
                rHtml = "<ul id='moreUl' class='display_none'>";
                for(i = 0; i <= (jsName.length - 2); i++){
                    if(i > moreIndex){
                        if(jsId[i] == {{ $id }}){
                            rHtml += "<li class='resume_name resumecheck'><a href=" + jsUrl[i] + "><span>" + jsName[i] + "</span></a></li>";
                        }else{
                            rHtml += "<li class='resume_name'><a href=" + jsUrl[i] + "><span>" + jsName[i] + "</span></a></li>";
                        }
                    }
                }
                rHtml += "</ul>";
                $("#browse_resume").append(rHtml);
            }

            $("#moreResume").mouseover(function(){
                moreUlCss = $("#moreUl");
                moreUlCss.css("position", "fixed");
                moreUlCss.show();
                moreUlCss.mouseleave(function(){
                    moreUlCss.hide(300);
                });
                var offset = $("#moreResume").offset();
                moreUlCss.css("left", (offset.left - $("#browse_resume").width()) + "px");
                currentTop = offset.top - $(document).scrollTop();
                moreUlCss.css('top', currentTop - (parseInt(jsName.length - moreIndex - 3) * 25) - 2 + "px");
            });
        });

        function define_browse_resume(){
            var w = document.body.clientWidth;
            var h = $(window).height();
            fix_h = parseFloat(h / 3);
            var obj = $("#browse_resume");
            if(w > (999 + (obj.width() * 1.5)) + 15){//可视界面 如果大于1200+元素宽1.5倍
                fix_w = parseFloat((w - 999) / 2) + 999 + 15;
            }else{//小于则紧贴右边缘
                fix_w = parseFloat(w - obj.width());
            }
            obj.css("left", fix_w + "px");
            obj.css('top', fix_h + "px");
            XY = new Array();
            XY['x'] = fix_w;
            XY['y'] = fix_h;
            return XY;
        }
        window.onload = function(){
            window.onresize = define_browse_resume;
            define_browse_resume();
        }
        //调整浮动框大小
        $(".buttom").click(function(){
            var h = $(window).height();
            fix_h = parseFloat(h / 3);
            $(".resume_name").hide();
            $(".buttom").hide();
            $("#browse_resume").animate({top: (h - 25 + 'px')});
            $(".topTitle").html("<b id='open'>打开</b>");
            $(".topTitle").find('#open').click(function(){
                $("#browse_resume").animate({top: (fix_h + 'px')});
                $(this).html("<b id='open'>简历库</b>");
                $(".resume_name").show();
                $(".buttom").show();
            })
        });

        //轮播图片
        var photoJson = {!! $photoJson !!};
        @if(count($worksArr) > 0)
            @foreach($worksArr as $k => $v)
                //查看图片
                $("#workImg" + "{{$v['id']}}").find('.img').eq(0).click(function(){
                    rotateImg(photoJson['{{$v['id']}}']);
                });
            @endforeach
        @endif
        function rotateImg(photoJson){
            layer.photos({
                photos: {
                    "title": '', //相册标题
                    "id": '', //相册id
                    "start": 0, //初始显示的图片序号，默认0
                    "data": photoJson
                },
                //显示关闭按钮
                closeBtn: 2,
                area: 'auto',
                //设置最大宽度
                maxWidth: '700',
                //是否显示拖拽
                move: false,
                //设置图片信息
                tab: function(pic, layero){
                    //console.log(pic) //当前图片的一些信息
                    $('.layui-layer-content').css({'border': '1px solid #444', 'padding': '10px'});
                },
                shift: 5 //0-6的选择，指定弹出图片动画类型，默认随机
            });
        }

    </script>
@endsection
